/*
 * @Author: taoyuqing
 * @Date: 2023-01-02 19:06:43
 * @Description: fairness_page页面内容
 */
import 'package:flutter/material.dart';
import 'package:spree/widgets/copty_input.dart';
import 'package:spree/widgets/vip_content_box.dart';
import 'package:spree/widgets/vip_rectangle_box.dart';

import '../utils/utils.dart';

class FairnessCard extends StatefulWidget {
  final String? stepNum;
  final String? stepTitle;
  final String? stepContent;
  final String? cardTitle;
  final String? cardContent;
  final String? copyContent;
  final Widget? child;
  FairnessCard(
      {Key? key,
      this.stepNum,
      this.stepTitle,
      this.stepContent,
      this.cardTitle,
      this.cardContent,
      this.copyContent,
      this.child})
      : super(key: key);

  @override
  State<FairnessCard> createState() => _FairnessCardState();
}

class _FairnessCardState extends State<FairnessCard> {
  @override
  Widget build(BuildContext context) {
    return VipContentBox(
      child: Container(
        padding: EdgeInsets.only(left: 20, right: 20),
        child: Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(widget.stepNum ?? '',
                    style: TextStyle(
                        color: Color.fromRGBO(0, 0, 0, 0.3),
                        fontSize: 60,
                        fontWeight: FontWeight.w800)),
                Text(widget.stepTitle ?? '',
                    style: TextStyle(
                        color: Color(0xFFFFED4A),
                        fontSize: 18,
                        fontWeight: FontWeight.w700)),
              ],
            ),
            Text(
              widget.stepContent ?? '',
              style: TextStyle(color: Colors.white),
            ),
            Container(
              margin: EdgeInsets.only(top: 20),
              child: VipRectangleBox(
                width: Utils().getScreenWidth(context),
                child: Column(
                  children: [
                    widget.cardTitle != null
                        ? Container(
                            margin: EdgeInsets.only(top: 20, bottom: 20),
                            child: Text(widget.cardTitle ?? '',
                                style: TextStyle(
                                    color: Color(0xFFFFED4A),
                                    fontSize: 14,
                                    fontWeight: FontWeight.w700)),
                          )
                        : Container(),
                    widget.cardContent != null
                        ? Container(
                            child: Text(
                            widget.cardContent ?? '',
                            style: TextStyle(color: Colors.white),
                          ))
                        : Container(),
                    widget.copyContent != null
                        ? Container(
                            padding: EdgeInsets.only(bottom: 20, top: 20),
                            child: CopyInput(
                              copyContent: widget.copyContent,
                              width: Utils().getScreenWidth(context),
                            ),
                          )
                        : Container(),
                    widget.child ?? Container()
                  ],
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
